package com.bawei.caohao20240805.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.bawei.comm.model.bean.BanBean
import com.bawei.comm.model.bean.ShiBean
import com.bawei.comm.model.util.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import retrofit2.http.Header

/**
 * 作者: 曹浩
 * 时间: 2024/8/5
 * 功能描述:
 */
class WelViewModel :ViewModel(){
    val bandata=MutableLiveData<BanBean>()
    fun getban(
        version:String,
    ){
        HttpUtils.httpUtils.server2.getban(version)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                bandata.value=it
            }
    }
    val shidata=MutableLiveData<ShiBean>()
    fun getshi(
        userId:Int,
        sessionId:String,
    ){
        HttpUtils.httpUtils.server.getshi(userId,sessionId)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                shidata.value=it
            }
    }

}